package com.yuliang.ai.controller;

import com.yuliang.ai.domain.Dto.PageDto;
import com.yuliang.ai.domain.Vo.HumanCollectionVo;
import com.yuliang.ai.service.HumanCollectionService;
import com.yuliang.utils.result.ResultUtils;
import com.yuliang.utils.result.emums.HttpCodeEnum;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author Huangkai
 */
@Slf4j
@RestController
@RequestMapping("/human")
public class HumanCollectionController {

    @Autowired
    HumanCollectionService humanCollectionService;

    @PostMapping("/getHumanCollectionList")
    public String getHumanCollectionList(@RequestBody HumanCollectionVo humanCollectionVo) {
        PageDto pageDto = humanCollectionService.getHumanCollectionList(humanCollectionVo);
        return ResultUtils.ResultWithMessageDataEnum(HttpCodeEnum.select_success, pageDto);
    }

    @PostMapping("/humanCollection")
    public String humanCollection(@RequestBody HumanCollectionVo humanCollectionVo) {
        return humanCollectionService.insertHumanCollection(humanCollectionVo);
    }
    @PostMapping("/delHumanCollection")
    public String delHumanCollection(@RequestBody HumanCollectionVo humanCollectionVo) {
        return humanCollectionService.delHumanCollection(humanCollectionVo);
    }

}
